home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / dns / rcode.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-09-17  |  2.6 KB  |  99 lines

  1. /*
  2.  * Copyright (C) 2004, 2005  Internet Systems Consortium, Inc. ("ISC")
  3.  * Copyright (C) 1999-2001  Internet Software Consortium.
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software for any
  6.  * purpose with or without fee is hereby granted, provided that the above
  7.  * copyright notice and this permission notice appear in all copies.
  8.  *
  9.  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  10.  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  11.  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  12.  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  13.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  14.  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15.  * PERFORMANCE OF THIS SOFTWARE.
  16.  */
  17.  
  18. /* $Id: rcode.h,v 1.13.18.2 2005/04/29 00:16:18 marka Exp $ */
  19.  
  20. #ifndef DNS_RCODE_H
  21. #define DNS_RCODE_H 1
  22.  
  23. /*! \file */
  24.  
  25. #include <isc/lang.h>
  26.  
  27. #include <dns/types.h>
  28.  
  29. ISC_LANG_BEGINDECLS
  30.  
  31. isc_result_t dns_rcode_fromtext(dns_rcode_t *rcodep, isc_textregion_t *source);
  32. /*%<
  33.  * Convert the text 'source' refers to into a DNS error value.
  34.  *
  35.  * Requires:
  36.  *\li    'rcodep' is a valid pointer.
  37.  *
  38.  *\li    'source' is a valid text region.
  39.  *
  40.  * Returns:
  41.  *\li    #ISC_R_SUCCESS            on success
  42.  *\li    #DNS_R_UNKNOWN            type is unknown
  43.  */
  44.  
  45. isc_result_t dns_rcode_totext(dns_rcode_t rcode, isc_buffer_t *target);
  46. /*%<
  47.  * Put a textual representation of error 'rcode' into 'target'.
  48.  *
  49.  * Requires:
  50.  *\li    'rcode' is a valid rcode.
  51.  *
  52.  *\li    'target' is a valid text buffer.
  53.  *
  54.  * Ensures:
  55.  *\li    If the result is success:
  56.  *        The used space in 'target' is updated.
  57.  *
  58.  * Returns:
  59.  *\li    #ISC_R_SUCCESS            on success
  60.  *\li    #ISC_R_NOSPACE            target buffer is too small
  61.  */
  62.  
  63. isc_result_t dns_tsigrcode_fromtext(dns_rcode_t *rcodep,
  64.                     isc_textregion_t *source);
  65. /*%<
  66.  * Convert the text 'source' refers to into a TSIG/TKEY error value.
  67.  *
  68.  * Requires:
  69.  *\li    'rcodep' is a valid pointer.
  70.  *
  71.  *\li    'source' is a valid text region.
  72.  *
  73.  * Returns:
  74.  *\li    #ISC_R_SUCCESS            on success
  75.  *\li    #DNS_R_UNKNOWN            type is unknown
  76.  */
  77.  
  78. isc_result_t dns_tsigrcode_totext(dns_rcode_t rcode, isc_buffer_t *target);
  79. /*%<
  80.  * Put a textual representation of TSIG/TKEY error 'rcode' into 'target'.
  81.  *
  82.  * Requires:
  83.  *\li    'rcode' is a valid TSIG/TKEY error code.
  84.  *
  85.  *\li    'target' is a valid text buffer.
  86.  *
  87.  * Ensures:
  88.  *\li    If the result is success:
  89.  *        The used space in 'target' is updated.
  90.  *
  91.  * Returns:
  92.  *\li    #ISC_R_SUCCESS            on success
  93.  *\li    #ISC_R_NOSPACE            target buffer is too small
  94.  */
  95.  
  96. ISC_LANG_ENDDECLS
  97.  
  98. #endif /* DNS_RCODE_H */
  99.